<template>
        <div class="data-content" v-if="!!qiyeinfo.ContentPlaceHolder1_lbUNSTID">
            <table class="layui-table">
                <tbody>
                    <tr>
                        <th colspan="2">统一社会信用代码</th>
                        <td colspan="3">
                            <span>{{ qiyeinfo.ContentPlaceHolder1_lbUNSTID }}</span>
                        </td>
                        <th colspan="2">发证机关</th>
                        <td colspan="3">
                            <span>{{ qiyeinfo.ContentPlaceHolder1_lbORGAN }}</span>
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">企业法定代表人</th>
                        <td colspan="3">
                            <span>{{ qiyeinfo.ContentPlaceHolder1_lbLR }}</span>
                        </td>
                        <th colspan="2">企业登记注册类型</th>
                        <td colspan="3">
                            <span>{{ qiyeinfo.ContentPlaceHolder1_lbATTR }}</span>
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">注册资本</th>
                        <td colspan="3">
                            <span>{{
                                qiyeinfo.ContentPlaceHolder1_lbCAPTIAL
                            }}</span>
                        </td>
                        <th colspan="2">成立日期</th>
                        <td colspan="3">
                            <span>{{ qiyeinfo.ContentPlaceHolder1_lbSTTIME }}</span>
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">所属省市</th>
                        <td colspan="3">
                            <span>{{ qiyeinfo.ContentPlaceHolder1_lbPNAME }}</span>
                        </td>
                        <th colspan="2">企业经营地址</th>
                        <td colspan="3">
                            <span>{{
                                qiyeinfo.ContentPlaceHolder1_lbADDRESS
                            }}</span>
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">经营范围</th>
                        <td colspan="8">
                            <span>{{ qiyeinfo.ContentPlaceHolder1_lbSCOPE }}</span>
                        </td>
                    </tr>
                </tbody>
            </table>
            <div style="display: block; height: 20px"></div>
            <table class="layui-table">
                <tbody>
                    <tr>
                        <th colspan="2" rowspan="2">
                            安全生产<br />
                            许可证
                        </th>
                        <td colspan="4" rowspan="2">
                            <span>{{ qiyeinfo.lbSAFEID }}</span>
                        </td>
                        <th colspan="2">发证机关</th>
                        <td colspan="7">
                            <span>{{ qiyeinfo.lbSAFEORGAN }}</span>
                        </td>
                        <th colspan="2">有效期至</th>
                        <td colspan="3">
                            <span>{{ qiyeinfo.lbSAFEVTIME }}</span>
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">许可范围</th>
                        <td colspan="12">
                            <span>{{ qiyeinfo.lbSAFESCOPE }}</span>
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">社保登记证号</th>
                        <td colspan="4">
                            <span>{{ qiyeinfo.lbSOCAILID }}</span>
                        </td>
                        <th colspan="2">发证机关</th>
                        <td colspan="12">
                            <span>{{ qiyeinfo.lbSOCIALJG }}</span>
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">
                            可查询<br />
                            网站链接
                        </th>
                        <td colspan="6">
                            <span>{{ qiyeinfo.lbHTTP }}</span>
                        </td>
                        <th colspan="2">管理制度</th>
                        <td colspan="10">
                            <div style="height: 40px; line-height: 40px">
                                <span>{{ qiyeinfo.lbMANZD }}</span>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">信用建设</th>
                        <th colspan="3">
                            是否建立信<br />
                            用管理部门
                        </th>
                        <td colspan="3">
                            <span>{{ qiyeinfo.lbbCREDIT }}</span>
                        </td>
                        <th colspan="3">
                            是否明确信用<br />
                            管理归口部门
                        </th>
                        <td colspan="3">
                            <span>{{ qiyeinfo.lbbCREDZD }}</span>
                        </td>
                        <th colspan="3">
                            是否有专职信用<br />
                            管理工作人员
                        </th>
                        <td colspan="3">
                            <span>{{ qiyeinfo.lbbCREDPER }}</span>
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">注册地址</th>
                        <td colspan="12">
                            <span>{{ qiyeinfo.lbREGADDRESS }}</span>
                            &nbsp;
                        </td>
                        <th colspan="3">邮政编码</th>
                        <td colspan="3">
                            <span>{{ qiyeinfo.lbREGPSCODE }}</span>
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">单位网址</th>
                        <td colspan="18">
                            <span>{{ qiyeinfo.lbWEBSITE }}</span>
                        </td>
                    </tr>

                    <tr>
                        <th colspan="2">主营业务</th>
                        <td colspan="18" style="text-align: left">
                            <span>{{ qiyeinfo.MAINYW }}</span>
                        </td>
                    </tr>
                </tbody>
            </table>
            <div style="display: block; height: 20px"></div>
            <table class="layui-table">
                <tbody>
                    <tr>
                        <th colspan="2">
                            管理体<br />
                            系认证
                        </th>
                        <td colspan="18">
                            <table
                                class="layui-table"
                            >
                                <colgroup>
                                    <col width="80" />
                                    <col />
                                    <col width="140" />
                                    <col width="140" />
                                </colgroup>
                                <thead>
                                    <tr>
                                        <th>序号</th>
                                        <th>名称</th>
                                        <th>有效期至</th>
                                        <th>监督审核日期</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr v-for="(trContent, index) in guanlitixi.list" :key="index">
                                        <td v-for="(colName, colNum) in guanlitixi.titles" :key="colNum">
                                            <div v-if="trContent.trContents[0].colVal != '没有记录'">
                                                {{ trContent.trContents[colNum].colVal }}
                                            </div>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </td>
                    </tr>
                </tbody>
            </table>
            <div style="display: block; height: 20px"></div>
            <table class="layui-table" v-if="!!danweilishi.list && danweilishi.list.length > 0">
                <tbody>
                    <tr>
                        <th colspan="2">
                            单位历<br />
                            史沿革
                        </th>
                        <td colspan="18">
                            <table
                                class="layui-table"
                            >
                                <colgroup>
                                    <col width="80" />
                                    <col width="140" />
                                    <col width="200" />
                                    <col width="200" />
                                </colgroup>
                                <thead>
                                    <tr>
                                        <th>序号</th>
                                        <th>时间</th>
                                        <th>单位名称</th>
                                        <th>备注</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr v-for="(trContent, index) in danweilishi.list" :key="index">
                                        <td v-for="(colName, colNum) in danweilishi.titles" :key="colNum">
                                            <div v-if="trContent.trContents[0].colVal != '没有记录'">
                                                {{ trContent.trContents[colNum].colVal }}
                                            </div>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </td>
                    </tr>
                </tbody>
            </table>
            <el-link type="info" :underline="false">*此数据来源于全国水利建设市场信用信息平台官方网站</el-link>
        </div>
        
        <div class="data-content" v-else>
            <div class="nodataDiv">
                <div class="nodataDiv">
                    <el-empty :image="imgUrl1" description="暂无企业信息"></el-empty>
                </div>
            </div>
        </div>
</template>

<script>
export default {
    props: {
        shuiliComId: {
            type: String,
            default: "",
        },
        projectId: {
            type: String,
            default: "",
        },
    },
    data: () => ({
        qiyeinfo: {
            list:[],
            titles:[]
        },
        guanlitixi: {
            list:[],
            titles:[]
        },
        danweilishi: {
            list:[],
            titles:[]
        },
        imgUrl1: require("../../img/wu01.png"),
    }),
    watch: {
        shuiliComId(newValue, oldValue) {
            if(newValue !== oldValue){
                this.getQiYeInfo();
            }
        }
    },
    methods: {
        //获取企业基本信息
        getQiYeInfo() {
            var that = this;
            if(!that.shuiliComId){return}
            this.$ajax({
                type: "get",
                url: `${this.$store.state.api.searchUrl}/searchshuili/shuili/qiyeinfo`,
                data: {
                    comId: that.shuiliComId,
                    projectId: that.projectId,
                },
                callback: function (data, res) {
                        that.qiyeinfo = data || {};
                        that.guanlitixi = data.guanlitixi || {list:[],titles:[]};
                        that.danweilishi = data.danweilishi || {list:[],titles:[]}
                
                },
            });
        },
    },
    mounted() {
        this.getQiYeInfo();
    },
};
</script>

<style scoped lang="scss">
.data-content {
    // border-bottom: 1px solid #efefef;
    padding: 0px 15px;
    .layui-table {
        width: 100%;
        border-collapse: collapse;

    }
    .layui-table td,
    .layui-table th {
        padding: 12px 10px;
        text-align: center;
        border: 1px solid #ddd;
        font-size: 15px;
    }
    .layui-table tr th {
        background: #f9f9f9;
        color: #333;
        position: inherit;
    }
    .nodataDiv {
            ::v-deep .el-empty__image {
                width: 80%;
            }
            ::v-deep .el-empty__image img {
                width: 80%;
                
            }
        }
}
</style>
